package com.gitee.wsl.android.ui.recyclerView.adapter.base

import com.gitee.wsl.base.WarpWithFlag
import com.gitee.wsl.ext.base.DEFAULT_BASE_FLAG
import com.gitee.wsl.ext.base.DEFAULT_FLAG

class AdapterItemWarp<T>(data:T): WarpWithFlag<T>(data) {

}

object AdapterItemFlag{
    val FLAG_ITEM_CATEGORY_ABLE = DEFAULT_BASE_FLAG shl 1
    val FLAG_ITEM_SELECTED = DEFAULT_BASE_FLAG shl 2
    val FLAG_ITEM_EXP = DEFAULT_BASE_FLAG shl 3

    val FLAG_ITEM_READ_ONLY =DEFAULT_BASE_FLAG shl 6
}

inline fun <reified T> Any.adapterItemWarp():AdapterItemWarp<T> {
    if(this is T)
       return AdapterItemWarp<T>(this as T)
    throw IllegalArgumentException("con not warp adapt item with this:$this")
}